package jp.seraph.same.common;

import java.util.HashMap;
import java.util.Map;

import jp.seraph.jsade.model.JointIdentifier;
import jp.seraph.jsade.model.nao.NaoJointIdentifier;
import jp.seraph.same.message.MessageUtil;

public class JapaneseJointNameMapper implements JointNameMapper {
    public JapaneseJointNameMapper(){
        mJointNameMap = new HashMap<JointIdentifier, String>();

        mJointNameMap.put(NaoJointIdentifier.HJ1, "首（左右）");
        mJointNameMap.put(NaoJointIdentifier.HJ2, "首（上下）");

        mJointNameMap.put(NaoJointIdentifier.LAJ1, "左肩（上下）");
        mJointNameMap.put(NaoJointIdentifier.LAJ2, "左肩（左右）");
        mJointNameMap.put(NaoJointIdentifier.LAJ3, "左肘（ねじり）");
        mJointNameMap.put(NaoJointIdentifier.LAJ4, "左肘（折畳み）");
        mJointNameMap.put(NaoJointIdentifier.RAJ1, "右肩（上下）");
        mJointNameMap.put(NaoJointIdentifier.RAJ2, "右肩（左右）");
        mJointNameMap.put(NaoJointIdentifier.RAJ3, "右肘（ねじり）");
        mJointNameMap.put(NaoJointIdentifier.RAJ4, "右肘（折畳み）");

        mJointNameMap.put(NaoJointIdentifier.LLJ1, "左股（ねじり）");
        mJointNameMap.put(NaoJointIdentifier.LLJ2, "左股（開脚）");
        mJointNameMap.put(NaoJointIdentifier.LLJ3, "左太腿（上下）");
        mJointNameMap.put(NaoJointIdentifier.LLJ4, "左膝（折畳み）");
        mJointNameMap.put(NaoJointIdentifier.LLJ5, "左足首（前後）");
        mJointNameMap.put(NaoJointIdentifier.LLJ6, "左足首（左右）");

        mJointNameMap.put(NaoJointIdentifier.RLJ1, "右股（ねじり）");
        mJointNameMap.put(NaoJointIdentifier.RLJ2, "右股（開脚）");
        mJointNameMap.put(NaoJointIdentifier.RLJ3, "右太腿（上下）");
        mJointNameMap.put(NaoJointIdentifier.RLJ4, "右膝（折畳み）");
        mJointNameMap.put(NaoJointIdentifier.RLJ5, "右足首（前後）");
        mJointNameMap.put(NaoJointIdentifier.RLJ6, "右足首（左右）");

    }

    private Map<JointIdentifier, String> mJointNameMap;

    /**
     * @see jp.seraph.same.common.JointNameMapper#toDisplayName(jp.seraph.jsade.model.JointIdentifier)
     */
    public String toDisplayName(JointIdentifier aIdentifier) {
        String tResult = mJointNameMap.get(aIdentifier);
        if(tResult == null)
            throw new IllegalArgumentException(MessageUtil.nosupportedJointIdentifier(aIdentifier));

        return tResult;
    }
}
